import 'package:flutter/material.dart';
import 'package:flutter_demo2/pages.dart';
import 'package:flutter_demo2/ui/list_remove_item_anime/list_cell.dart';
import 'package:flutter_demo2/ui/visible_detector/visible_detector_wrapper.dart';
import 'package:route/route.dart';

class TestVisibilityDetectorPage extends StatefulWidget {
  const TestVisibilityDetectorPage({Key? key}) : super(key: key);

  @override
  State<TestVisibilityDetectorPage> createState() => _TestVisibilityDetectorPageState();
}

class _TestVisibilityDetectorPageState extends State<TestVisibilityDetectorPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("test visibility detector"),
      ),
      body: ListView(
        children: [
          GestureDetector(
            child: const VisibleDetectorWrapper(),
            onTap: () {
              router.openFlutterPage(FlutterPages.testNestedScrollPage);
            },
          ),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
          Container(height: 100, width: 200, color: randomColor()),
        ],
      ),
    );
  }
}
